//---------------------------------------------------------------------------


#pragma hdrstop
#include <vcl.h>

#include "utils.h"
#include "Unit2.h"
#include <math.h>

//---------------------------------------------------------------------------
void Delay(DWORD DT)
{
 long tt;
 tt=GetTickCount();
 while (GetTickCount()-tt < DT*2)
 {
  Application->ProcessMessages();
  if ((GetTickCount()-tt)<=0)
    tt=GetTickCount();
    Sleep(1);
 }
}
//---------------------------------------------------------------------------
void ShowNow(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

TDateTime   dt   =   Now();
AnsiString   st   =   dt.FormatString( "YYYYY-MM-DD   HH:NN:SS ");
//ShowMessage(st);

Form2->RichEdit1->Lines->Add(st);

}
//---------------------------------------------------------------------------
AnsiString ShowDate(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

TDateTime   dt   =   Now();
AnsiString   date   =   dt.FormatString( "YYYYY-MM-DD");
//ShowMessage(st);

Form2->RichEdit1->Lines->Add(date);
return  date;
}
//---------------------------------------------------------------------------
AnsiString ShowTime(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

TDateTime   dt   =   Now();
AnsiString   tt   =   dt.FormatString( "HH:NN:SS");
//ShowMessage(st);

Form2->RichEdit1->Lines->Add(tt);
return tt;

}
//---------------------------------------------------------------------------

#pragma package(smart_init)
